import request from "@/utils/request";

// export function login(data) {
//   return request({
//     url: '/vue-element-admin/user/login',
//     method: 'post',
//     data
//   })
// }
export function login(params) {
  return request.post("/login", params);
}
export function getInfo(token) {
  return request({
    url: "/vue-element-admin/user/info",
    method: "get",
    params: { token },
  });
}

// export function logout() {
//   return request({
//     url: '/vue-element-admin/user/logout',
//     method: 'post'
//   })
// }
export function logout() {
  return request({
    url: "/logout",
    method: "get",
  });
}

export function getCode() {
  return request({
    url: "captcha/captchaImage?type=newCode",
    method: "get",
  });
}


// 修改个人资料
export function updateUser(params) {
  return request.post("/system/user/profile/update", params);
}

// 修改密码
export function updatePsd(params) {
  return request.post("/system/user/profile/resetPwd", params);
}

// 修改头像

export function updateAvatar(params) {
  return request.post("/system/user/profile/notCommonType/updateAvatar", params);
}

// 登录人菜单路由信息
export function getRoutes(params) {
   return request.post("/getRouters", params)
}

// 获取用户信息
export function getUserInfo(params) {
  return request.post("/clickLogin", params);
}